unit Controller.Test;

interface

uses
  System.SysUtils, System.Classes, MVC.JSON, MVC.DataSet, Controller.Base,
  mvc.db;

type
  [MURL('test', 'test')]
  TtestController = class(TBaseController)
  public
    procedure Index(map: IJObject);
    function test: IJObject;
    procedure report;
    function Intercept: Boolean; override;
  end;

implementation

uses
  Service.Report;

{ TtestController }

procedure TtestController.Index;
begin

end;

function TtestController.Intercept: Boolean;
begin
  Result := false;

end;

procedure TtestController.report;
var
  rep: TReport;
  filname:string;
begin
  filname:=GetGUID;
  filname := rep.expPDF(filname);
  filname:=WebPath+filname;
  ShowFile(filname);
end;

function TtestController.test: IJObject;
var
  json: IJObject;
  db: IConn;
begin
  db := IIConn;
  db.DB.Query('select * from users');
  json := iijobject();
  json.S['ok'] := 'hllo';
  Result := json;
end;

end.

